/**
 * 工程名称:oms
 * 文件名称:ProjectStockFmlaVO.java
 * 所属包:cn.rkylin.oms.system.stockpush.vo
 * 创建时间:2017年9月4日下午3:02:53
 * Copyright (c) 2017 瑞金麟(大连)信息技术有限公司 All Rights Reserved.
 * 创建人:zhanghao
 */

package cn.rkylin.oms.system.stockpush.vo;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 类名:ProjectStockFmlaVO <br/>
 * 作用: 库存推送需要选择项目，本VO用于传递项目列表信息. <br/>
 * 创建原因: 组合项目信息与库存推送信息. <br/>
 * 创建时间: 2017年9月4日 下午3:02:53 <br/>
 * 
 * @author zhanghao
 * @version v1.0
 * @since JDK 1.6
 * @see
 */
public class ProjectStockFmlaVO {
    /**
     * projectId:项目ID.
     * 
     * @since JDK 1.6
     */
    private String projectId;
    /**
     * projectName:项目名称.
     * 
     * @since JDK 1.6
     */
    private String projectName;
    /**
     * isFmlaSet:是否设置了公式.
     * 
     * @since JDK 1.6
     */
    private String isFmlaSet;
    /**
     * isFmlaRatioStorageSet:是否设置了库存推送比例.
     * 
     * @since JDK 1.6
     */
    private String isFmlaRatioStorageSet;
    /**
     * isFmlaRatioSkuSet:是否设置了商品推送比例.
     * 
     * @since JDK 1.6
     */
    private String isFmlaRatioSkuSet;
    /**
     * fmlaContent:公式内容.
     * 
     * @since JDK 1.6
     */
    private String fmlaContent;
    /**
     * fmlaRatioStorageContent:库存推送比例内容：已设置仓库数／仓库总数.
     * 
     * @since JDK 1.6
     */
    private String fmlaRatioStorageContent;
    /**
     * fmlaRatioSkuContent:已设置商品数／商品总数.
     * 
     * @since JDK 1.6
     */
    private String fmlaRatioSkuContent;

    /**
     * updateTime:上次更新时间.
     * 
     * @since JDK 1.6
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;
    /**
     * stockType:库存获取类型：本地计算；第三方推送.
     * 
     * @since JDK 1.6
     */
    private String stockType;

    public String getStockType() {
        return stockType;
    }

    public void setStockType(String stockType) {
        this.stockType = stockType;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getProjectId() {
        return projectId;
    }

    public void setProjectId(String projectId) {
        this.projectId = projectId;
    }

    public String getProjectName() {
        return projectName;
    }

    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }

    public String getIsFmlaSet() {
        return isFmlaSet;
    }

    public void setIsFmlaSet(String isFmlaSet) {
        this.isFmlaSet = isFmlaSet;
    }

    public String getIsFmlaRatioStorageSet() {
        return isFmlaRatioStorageSet;
    }

    public void setIsFmlaRatioStorageSet(String isFmlaRatioStorageSet) {
        this.isFmlaRatioStorageSet = isFmlaRatioStorageSet;
    }

    public String getIsFmlaRatioSkuSet() {
        return isFmlaRatioSkuSet;
    }

    public void setIsFmlaRatioSkuSet(String isFmlaRatioSkuSet) {
        this.isFmlaRatioSkuSet = isFmlaRatioSkuSet;
    }

    public String getFmlaContent() {
        return fmlaContent;
    }

    public void setFmlaContent(String fmlaContent) {
        this.fmlaContent = fmlaContent;
    }

    public String getFmlaRatioStorageContent() {
        return fmlaRatioStorageContent;
    }

    public void setFmlaRatioStorageContent(String fmlaRatioStorageContent) {
        this.fmlaRatioStorageContent = fmlaRatioStorageContent;
    }

    public String getFmlaRatioSkuContent() {
        return fmlaRatioSkuContent;
    }

    public void setFmlaRatioSkuContent(String fmlaRatioSkuContent) {
        this.fmlaRatioSkuContent = fmlaRatioSkuContent;
    }

    /**
     * operation:操作按钮.
     * 
     * @since JDK 1.6
     */
    private String operation;
    // 库存公式
    private static final String OPERATION_BTN_FMLA = "<button id=\"%s\" type=\"button\" class=\"btn btn-info btn-xs\" onclick='stockpush.fmlaSet(this)'><i class=\"fa fa-superscript\"></i>&nbsp;库存公式</button>&nbsp";
    // 仓库推送比例设置
    private static final String OPERATION_BTN_FMLA_RATIO_STOCK = "<button  id=\"%s\"type=\"button\" class=\"btn btn-info btn-xs\" onclick='stockpush.fmlaRatioStockSet(this)'><i class=\"fa fa-pencil-square-o\"></i>&nbsp;设置仓库推送比例</button>&nbsp";
    // // 商品推送比例设置
    // private static final String OPERATION_BTN_FMLA_RATIO_SKU = "<button
    // id=\"%s\" type=\"button\" class=\"btn btn-warning btn-xs\"
    // onclick='stockpush.fmlaRatioSkuSet(this)'><i class=\"fa
    // fa-arrow-circle-right\"></i>&nbsp;设置商品推送比例</button>&nbsp";
    // 清除日志
    private static final String OPERATION_BTN_FMLA_CLEAR = "<button style=\"display:none;\" id=\"%s\" type=\"button\" class=\"btn btn-danger btn-xs\" onclick='stockpush.fmlaClearSet(this)'><i class=\"fa fa-trash-o\"></i>&nbsp;清除设置</button>&nbsp";

    public String getOperation() {
        return operation;
    }

    public void setOperation(String operation) {
        StringBuilder strbuilder = new StringBuilder();
        strbuilder.append(String.format(OPERATION_BTN_FMLA, getProjectId()))
                .append(String.format(OPERATION_BTN_FMLA_RATIO_STOCK, getProjectId()))
                // .append(String.format(OPERATION_BTN_FMLA_RATIO_SKU,
                // getProjectId()))
                .append(String.format(OPERATION_BTN_FMLA_CLEAR, getProjectId()));
        this.operation = strbuilder.toString();
    }

}
